﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_YG_YONGHUXX实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class QS_YG_YONGHUXX
    {

        private decimal m_dec_id;
        /// <summary>
        /// 主键
        /// </summary>
        public decimal ID { get { return m_dec_id; } set { m_dec_id = value; } }

        private string m_str_s_xingzhengqbh;
        /// <summary>
        /// 行政区编号
        /// </summary>
        public string S_XINGZHENGQBH { get { return m_str_s_xingzhengqbh; } set { m_str_s_xingzhengqbh = value; } }

        private string m_str_s_bumenbh;
        /// <summary>
        /// 部门编号
        /// </summary>
        public string S_BUMENBH { get { return m_str_s_bumenbh; } set { m_str_s_bumenbh = value; } }

        private string m_str_s_yonghuh;
        /// <summary>
        /// 用户号
        /// </summary>
        public string S_YONGHUH { get { return m_str_s_yonghuh; } set { m_str_s_yonghuh = value; } }

        private string m_str_s_yonghum;
        /// <summary>
        /// 用户名
        /// </summary>
        public string S_YONGHUM { get { return m_str_s_yonghum; } set { m_str_s_yonghum = value; } }

        private string m_str_s_youbian;
        /// <summary>
        /// 邮编
        /// </summary>
        public string S_YOUBIAN { get { return m_str_s_youbian; } set { m_str_s_youbian = value; } }

        private string m_str_s_dizhi;
        /// <summary>
        /// 地址
        /// </summary>
        public string S_DIZHI { get { return m_str_s_dizhi; } set { m_str_s_dizhi = value; } }

        private string m_str_s_dianhua;
        /// <summary>
        /// 电话
        /// </summary>
        public string S_DIANHUA { get { return m_str_s_dianhua; } set { m_str_s_dianhua = value; } }

        private string m_str_s_lianxibm;
        /// <summary>
        /// 联系部门
        /// </summary>
        public string S_LIANXIBM { get { return m_str_s_lianxibm; } set { m_str_s_lianxibm = value; } }

        private string m_str_s_lianxir;
        /// <summary>
        /// 联系人
        /// </summary>
        public string S_LIANXIR { get { return m_str_s_lianxir; } set { m_str_s_lianxir = value; } }

        private string m_str_s_liuyubh;
        /// <summary>
        /// 流域编号ValleyGuid
        /// </summary>
        public string S_LIUYUBH { get { return m_str_s_liuyubh; } set { m_str_s_liuyubh = value; } }

        private string m_str_s_shuiziybh;
        /// <summary>
        /// 水资源编号WaterAreaGuid
        /// </summary>
        public string S_SHUIZIYBH { get { return m_str_s_shuiziybh; } set { m_str_s_shuiziybh = value; } }

        private string m_str_s_fenpianbh;
        /// <summary>
        /// 水利分片编号WaterPieceGuid
        /// </summary>
        public string S_FENPIANBH { get { return m_str_s_fenpianbh; } set { m_str_s_fenpianbh = value; } }

        private string m_str_s_huanxianbj;
        /// <summary>
        /// 环线标记CircleLineTypeGuid
        /// </summary>
        public string S_HUANXIANBJ { get { return m_str_s_huanxianbj; } set { m_str_s_huanxianbj = value; } }

        private string m_str_s_qushuiytbh;
        /// <summary>
        /// 取水用途编号WaterUsageGuid
        /// </summary>
        public string S_QUSHUIYTBH { get { return m_str_s_qushuiytbh; } set { m_str_s_qushuiytbh = value; } }

        private string m_str_s_hangyebh;
        /// <summary>
        /// 行业类型编号IndustryTypeGuid
        /// </summary>
        public string S_HANGYEBH { get { return m_str_s_hangyebh; } set { m_str_s_hangyebh = value; } }

        private decimal? m_dec_n_shuijia;
        /// <summary>
        /// 水价
        /// </summary>
        public decimal? N_SHUIJIA { get { return m_dec_n_shuijia; } set { m_dec_n_shuijia = value; } }

        private decimal? m_dec_i_biaoshi;
        /// <summary>
        /// bConsign
        /// </summary>
        public decimal? I_BIAOSHI { get { return m_dec_i_biaoshi; } set { m_dec_i_biaoshi = value; } }

        private string m_str_s_kaihuhm;
        /// <summary>
        /// 开户户名
        /// </summary>
        public string S_KAIHUHM { get { return m_str_s_kaihuhm; } set { m_str_s_kaihuhm = value; } }

        private string m_str_s_kaihuh;
        /// <summary>
        /// 开户号
        /// </summary>
        public string S_KAIHUH { get { return m_str_s_kaihuh; } set { m_str_s_kaihuh = value; } }

        private string m_str_s_kaihuyh;
        /// <summary>
        /// 开户银行
        /// </summary>
        public string S_KAIHUYH { get { return m_str_s_kaihuyh; } set { m_str_s_kaihuyh = value; } }

        private string m_str_s_yewuy;
        /// <summary>
        /// 业务员sBusinessmanGuid
        /// </summary>
        public string S_YEWUY { get { return m_str_s_yewuy; } set { m_str_s_yewuy = value; } }

        private string m_str_s_zhushi;
        /// <summary>
        /// sDemo
        /// </summary>
        public string S_ZHUSHI { get { return m_str_s_zhushi; } set { m_str_s_zhushi = value; } }

        private decimal? m_dec_i_wtype;
        /// <summary>
        /// 类型
        /// </summary>
        public decimal? I_WTYPE { get { return m_dec_i_wtype; } set { m_dec_i_wtype = value; } }

        private decimal? m_dec_i_jlzt;
        /// <summary>
        /// 记录状态
        /// </summary>
        public decimal? I_JLZT { get { return m_dec_i_jlzt; } set { m_dec_i_jlzt = value; } }

        private string m_str_s_tianjiar;
        /// <summary>
        /// 添加人
        /// </summary>
        public string S_TIANJIAR { get { return m_str_s_tianjiar; } set { m_str_s_tianjiar = value; } }

        private DateTime? m_DT_d_tianjiarq;
        /// <summary>
        /// 添加日期
        /// </summary>
        public DateTime? D_TIANJIARQ { get { return m_DT_d_tianjiarq; } set { m_DT_d_tianjiarq = value; } }

        private string m_str_s_caozuor;
        /// <summary>
        /// 操作人
        /// </summary>
        public string S_CAOZUOR { get { return m_str_s_caozuor; } set { m_str_s_caozuor = value; } }

        private DateTime? m_DT_d_caozuorq;
        /// <summary>
        /// 操作日期
        /// </summary>
        public DateTime? D_CAOZUORQ { get { return m_DT_d_caozuorq; } set { m_DT_d_caozuorq = value; } }

        private string m_str_s_yuanyonghuh;
        /// <summary>
        /// SourceUserGuid
        /// </summary>
        public string S_YUANYONGHUH { get { return m_str_s_yuanyonghuh; } set { m_str_s_yuanyonghuh = value; } }

        private string m_str_s_destuser;
        /// <summary>
        /// DestUserGuid
        /// </summary>
        public string S_DESTUSER { get { return m_str_s_destuser; } set { m_str_s_destuser = value; } }

        private string m_str_s_kaishiny;
        /// <summary>
        /// 开始年月sWaterYearMonthStart
        /// </summary>
        public string S_KAISHINY { get { return m_str_s_kaishiny; } set { m_str_s_kaishiny = value; } }

        private string m_str_s_jieshuny;
        /// <summary>
        /// 结束年月sWaterYearMonthEnd
        /// </summary>
        public string S_JIESHUNY { get { return m_str_s_jieshuny; } set { m_str_s_jieshuny = value; } }

        private string m_str_s_caiwuyb;
        /// <summary>
        /// 财务邮编2sPostCode2
        /// </summary>
        public string S_CAIWUYB { get { return m_str_s_caiwuyb; } set { m_str_s_caiwuyb = value; } }

        private string m_str_s_caiwudz;
        /// <summary>
        /// 财务地址2sAddress2
        /// </summary>
        public string S_CAIWUDZ { get { return m_str_s_caiwudz; } set { m_str_s_caiwudz = value; } }

        private string m_str_s_hetongh;
        /// <summary>
        /// 合同号sContractNumber
        /// </summary>
        public string S_HETONGH { get { return m_str_s_hetongh; } set { m_str_s_hetongh = value; } }

        private string m_str_s_yinhang;
        /// <summary>
        /// 银行sBank
        /// </summary>
        public string S_YINHANG { get { return m_str_s_yinhang; } set { m_str_s_yinhang = value; } }

        private string m_str_s_caiwuhm;
        /// <summary>
        /// 财务户名sName2
        /// </summary>
        public string S_CAIWUHM { get { return m_str_s_caiwuhm; } set { m_str_s_caiwuhm = value; } }

        private string m_str_s_zhuangbiaojl;
        /// <summary>
        /// 装表记录
        /// </summary>
        public string S_ZHUANGBIAOJL { get { return m_str_s_zhuangbiaojl; } set { m_str_s_zhuangbiaojl = value; } }

        private string m_str_s_feetype;
        /// <summary>
        /// FeeTypeGuid
        /// </summary>
        public string S_FEETYPE { get { return m_str_s_feetype; } set { m_str_s_feetype = value; } }

        private decimal? m_dec_i_yonghuzt;
        /// <summary>
        /// 用户状态(0:正常;1:分户;2:并户;3:销户;4:改户;5:销表 -1:其他或不明)
        /// </summary>
        public decimal? I_YONGHUZT { get { return m_dec_i_yonghuzt; } set { m_dec_i_yonghuzt = value; } }

        private string m_str_s_caiwubm;
        /// <summary>
        /// 财务部门(用于深井水费缴纳通知书,)
        /// </summary>
        public string S_CAIWUBM { get { return m_str_s_caiwubm; } set { m_str_s_caiwubm = value; } }

        private string m_str_s_by1;
        /// <summary>
        /// 
        /// </summary>
        public string S_BY1 { get { return m_str_s_by1; } set { m_str_s_by1 = value; } }

        private string m_str_s_by2;
        /// <summary>
        /// 
        /// </summary>
        public string S_BY2 { get { return m_str_s_by2; } set { m_str_s_by2 = value; } }

        private string m_str_s_by3;
        /// <summary>
        /// 
        /// </summary>
        public string S_BY3 { get { return m_str_s_by3; } set { m_str_s_by3 = value; } }

        private decimal? m_dec_i_by1;
        /// <summary>
        /// 
        /// </summary>
        public decimal? I_BY1 { get { return m_dec_i_by1; } set { m_dec_i_by1 = value; } }

        private decimal? m_dec_i_by2;
        /// <summary>
        /// 
        /// </summary>
        public decimal? I_BY2 { get { return m_dec_i_by2; } set { m_dec_i_by2 = value; } }

        private decimal? m_dec_i_by3;
        /// <summary>
        /// 
        /// </summary>
        public decimal? I_BY3 { get { return m_dec_i_by3; } set { m_dec_i_by3 = value; } }
        public QS_YG_YONGHUXX()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace BLL.Access
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class QS_YG_YONGHUXXProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public QS_YG_YONGHUXXProcess() { conn = Platform.Configuration.ConfigHelper.PlatformConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据QS_YG_YONGHUXX实体添加或者修改QS_YG_YONGHUXX信息
        /// </summary>
        public bool InsertOrUpdate(QS_YG_YONGHUXX QS_YG_YONGHUXX, OracleTransaction Transaction)
        {
            if (QS_YG_YONGHUXX.ID == 0)
            {
                InsertQS_YG_YONGHUXX(QS_YG_YONGHUXX, Transaction);
            }
            else
            {
                UpdateQS_YG_YONGHUXX(QS_YG_YONGHUXX, Transaction);
            }
            return QS_YG_YONGHUXX.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据QS_YG_YONGHUXX实体添加或修改QS_YG_YONGHUXX信息
        /// </summary>
        public bool InsertOrUpdate(QS_YG_YONGHUXX QS_YG_YONGHUXX)
        {
            return InsertOrUpdate(QS_YG_YONGHUXX, null);
        }



        /// <summary>
        /// 根据QS_YG_YONGHUXX主键删除QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_YG_YONGHUXX(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelQS_YG_YONGHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据QS_YG_YONGHUXX主键删除QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_YG_YONGHUXX(decimal ID)
        {
            return DeleteQS_YG_YONGHUXX(ID, null);
        }

        /// <summary>
        /// 根据条件删除QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_YG_YONGHUXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelQS_YG_YONGHUXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_YG_YONGHUXXesDynamic(string WhereClause)
        {
            return DeleteQS_YG_YONGHUXXesDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据QS_YG_YONGHUXX主键选择QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YG_YONGHUXX信息</returns>
        public QS_YG_YONGHUXX SelectQS_YG_YONGHUXX(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelQS_YG_YONGHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                QS_YG_YONGHUXX QS_YG_YONGHUXX = PopulateQS_YG_YONGHUXX(rd);
                rd.Close();
                return QS_YG_YONGHUXX;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据QS_YG_YONGHUXX主键选择QS_YG_YONGHUXX信息
        /// </summary>
        /// <returns>QS_YG_YONGHUXX信息</returns>
        public QS_YG_YONGHUXX SelectQS_YG_YONGHUXX(decimal ID)
        {
            return SelectQS_YG_YONGHUXX(ID, null);
        }

        /// <summary>
        /// 选择所有QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_YG_YONGHUXX信息</returns>
        public DataTable SelectQS_YG_YONGHUXXesAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelQS_YG_YONGHUXXesAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有QS_YG_YONGHUXX信息
        /// </summary>
        /// <returns>所有QS_YG_YONGHUXX信息</returns>
        public DataTable SelectQS_YG_YONGHUXXesAll()
        {
            return SelectQS_YG_YONGHUXXesAll(null);
        }

        /// <summary>
        /// 根据条件选择QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YG_YONGHUXX信息</returns>
        public DataTable SelectQS_YG_YONGHUXXesDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelQS_YG_YONGHUXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_YG_YONGHUXX信息</returns>
        public DataTable SelectQS_YG_YONGHUXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_YG_YONGHUXXesDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YG_YONGHUXX信息</returns>
        public DataTable SelectQS_YG_YONGHUXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelQS_YG_YONGHUXXesDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择QS_YG_YONGHUXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_YG_YONGHUXX信息</returns>
        public DataTable SelectQS_YG_YONGHUXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectQS_YG_YONGHUXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新QS_YG_YONGHUXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_YG_YONGHUXXesDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdQS_YG_YONGHUXXDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新QS_YG_YONGHUXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_YG_YONGHUXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_YG_YONGHUXXesDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertQS_YG_YONGHUXX(QS_YG_YONGHUXX QS_YG_YONGHUXX, OracleTransaction Transaction)
        {
            string spName = "CS_InsQS_YG_YONGHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_YG_YONGHUXX.S_XINGZHENGQBH;
            storedParams[1].Value = QS_YG_YONGHUXX.S_BUMENBH;
            storedParams[2].Value = QS_YG_YONGHUXX.S_YONGHUH;
            storedParams[3].Value = QS_YG_YONGHUXX.S_YONGHUM;
            storedParams[4].Value = QS_YG_YONGHUXX.S_YOUBIAN;
            storedParams[5].Value = QS_YG_YONGHUXX.S_DIZHI;
            storedParams[6].Value = QS_YG_YONGHUXX.S_DIANHUA;
            storedParams[7].Value = QS_YG_YONGHUXX.S_LIANXIBM;
            storedParams[8].Value = QS_YG_YONGHUXX.S_LIANXIR;
            storedParams[9].Value = QS_YG_YONGHUXX.S_LIUYUBH;
            storedParams[10].Value = QS_YG_YONGHUXX.S_SHUIZIYBH;
            storedParams[11].Value = QS_YG_YONGHUXX.S_FENPIANBH;
            storedParams[12].Value = QS_YG_YONGHUXX.S_HUANXIANBJ;
            storedParams[13].Value = QS_YG_YONGHUXX.S_QUSHUIYTBH;
            storedParams[14].Value = QS_YG_YONGHUXX.S_HANGYEBH;
            storedParams[15].Value = QS_YG_YONGHUXX.N_SHUIJIA;
            storedParams[16].Value = QS_YG_YONGHUXX.I_BIAOSHI;
            storedParams[17].Value = QS_YG_YONGHUXX.S_KAIHUHM;
            storedParams[18].Value = QS_YG_YONGHUXX.S_KAIHUH;
            storedParams[19].Value = QS_YG_YONGHUXX.S_KAIHUYH;
            storedParams[20].Value = QS_YG_YONGHUXX.S_YEWUY;
            storedParams[21].Value = QS_YG_YONGHUXX.S_ZHUSHI;
            storedParams[22].Value = QS_YG_YONGHUXX.I_WTYPE;
            storedParams[23].Value = QS_YG_YONGHUXX.I_JLZT;
            storedParams[24].Value = QS_YG_YONGHUXX.S_TIANJIAR;
            storedParams[25].Value = QS_YG_YONGHUXX.D_TIANJIARQ;
            storedParams[26].Value = QS_YG_YONGHUXX.S_CAOZUOR;
            storedParams[27].Value = QS_YG_YONGHUXX.D_CAOZUORQ;
            storedParams[28].Value = QS_YG_YONGHUXX.S_YUANYONGHUH;
            storedParams[29].Value = QS_YG_YONGHUXX.S_DESTUSER;
            storedParams[30].Value = QS_YG_YONGHUXX.S_KAISHINY;
            storedParams[31].Value = QS_YG_YONGHUXX.S_JIESHUNY;
            storedParams[32].Value = QS_YG_YONGHUXX.S_CAIWUYB;
            storedParams[33].Value = QS_YG_YONGHUXX.S_CAIWUDZ;
            storedParams[34].Value = QS_YG_YONGHUXX.S_HETONGH;
            storedParams[35].Value = QS_YG_YONGHUXX.S_YINHANG;
            storedParams[36].Value = QS_YG_YONGHUXX.S_CAIWUHM;
            storedParams[37].Value = QS_YG_YONGHUXX.S_ZHUANGBIAOJL;
            storedParams[38].Value = QS_YG_YONGHUXX.S_FEETYPE;
            storedParams[39].Value = QS_YG_YONGHUXX.I_YONGHUZT;
            storedParams[40].Value = QS_YG_YONGHUXX.S_CAIWUBM;
            storedParams[41].Value = QS_YG_YONGHUXX.S_BY1;
            storedParams[42].Value = QS_YG_YONGHUXX.S_BY2;
            storedParams[43].Value = QS_YG_YONGHUXX.S_BY3;
            storedParams[44].Value = QS_YG_YONGHUXX.I_BY1;
            storedParams[45].Value = QS_YG_YONGHUXX.I_BY2;
            storedParams[46].Value = QS_YG_YONGHUXX.I_BY3;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_YG_YONGHUXX.ID = Convert.ToInt32(storedParams[47].Value);
            return result;
        }
        private bool UpdateQS_YG_YONGHUXX(QS_YG_YONGHUXX QS_YG_YONGHUXX, OracleTransaction Transaction)
        {
            string spName = "CS_UpdQS_YG_YONGHUXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_YG_YONGHUXX.S_XINGZHENGQBH;
            storedParams[1].Value = QS_YG_YONGHUXX.S_BUMENBH;
            storedParams[2].Value = QS_YG_YONGHUXX.S_YONGHUH;
            storedParams[3].Value = QS_YG_YONGHUXX.S_YONGHUM;
            storedParams[4].Value = QS_YG_YONGHUXX.S_YOUBIAN;
            storedParams[5].Value = QS_YG_YONGHUXX.S_DIZHI;
            storedParams[6].Value = QS_YG_YONGHUXX.S_DIANHUA;
            storedParams[7].Value = QS_YG_YONGHUXX.S_LIANXIBM;
            storedParams[8].Value = QS_YG_YONGHUXX.S_LIANXIR;
            storedParams[9].Value = QS_YG_YONGHUXX.S_LIUYUBH;
            storedParams[10].Value = QS_YG_YONGHUXX.S_SHUIZIYBH;
            storedParams[11].Value = QS_YG_YONGHUXX.S_FENPIANBH;
            storedParams[12].Value = QS_YG_YONGHUXX.S_HUANXIANBJ;
            storedParams[13].Value = QS_YG_YONGHUXX.S_QUSHUIYTBH;
            storedParams[14].Value = QS_YG_YONGHUXX.S_HANGYEBH;
            storedParams[15].Value = QS_YG_YONGHUXX.N_SHUIJIA;
            storedParams[16].Value = QS_YG_YONGHUXX.I_BIAOSHI;
            storedParams[17].Value = QS_YG_YONGHUXX.S_KAIHUHM;
            storedParams[18].Value = QS_YG_YONGHUXX.S_KAIHUH;
            storedParams[19].Value = QS_YG_YONGHUXX.S_KAIHUYH;
            storedParams[20].Value = QS_YG_YONGHUXX.S_YEWUY;
            storedParams[21].Value = QS_YG_YONGHUXX.S_ZHUSHI;
            storedParams[22].Value = QS_YG_YONGHUXX.I_WTYPE;
            storedParams[23].Value = QS_YG_YONGHUXX.I_JLZT;
            storedParams[24].Value = QS_YG_YONGHUXX.S_TIANJIAR;
            storedParams[25].Value = QS_YG_YONGHUXX.D_TIANJIARQ;
            storedParams[26].Value = QS_YG_YONGHUXX.S_CAOZUOR;
            storedParams[27].Value = QS_YG_YONGHUXX.D_CAOZUORQ;
            storedParams[28].Value = QS_YG_YONGHUXX.S_YUANYONGHUH;
            storedParams[29].Value = QS_YG_YONGHUXX.S_DESTUSER;
            storedParams[30].Value = QS_YG_YONGHUXX.S_KAISHINY;
            storedParams[31].Value = QS_YG_YONGHUXX.S_JIESHUNY;
            storedParams[32].Value = QS_YG_YONGHUXX.S_CAIWUYB;
            storedParams[33].Value = QS_YG_YONGHUXX.S_CAIWUDZ;
            storedParams[34].Value = QS_YG_YONGHUXX.S_HETONGH;
            storedParams[35].Value = QS_YG_YONGHUXX.S_YINHANG;
            storedParams[36].Value = QS_YG_YONGHUXX.S_CAIWUHM;
            storedParams[37].Value = QS_YG_YONGHUXX.S_ZHUANGBIAOJL;
            storedParams[38].Value = QS_YG_YONGHUXX.S_FEETYPE;
            storedParams[39].Value = QS_YG_YONGHUXX.I_YONGHUZT;
            storedParams[40].Value = QS_YG_YONGHUXX.S_CAIWUBM;
            storedParams[41].Value = QS_YG_YONGHUXX.S_BY1;
            storedParams[42].Value = QS_YG_YONGHUXX.S_BY2;
            storedParams[43].Value = QS_YG_YONGHUXX.S_BY3;
            storedParams[44].Value = QS_YG_YONGHUXX.I_BY1;
            storedParams[45].Value = QS_YG_YONGHUXX.I_BY2;
            storedParams[46].Value = QS_YG_YONGHUXX.I_BY3;
            storedParams[47].Value = QS_YG_YONGHUXX.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_YG_YONGHUXX PopulateQS_YG_YONGHUXX(IDataReader dr)
        {
            QS_YG_YONGHUXX QS_YG_YONGHUXX = new QS_YG_YONGHUXX();
            QS_YG_YONGHUXX.ID = dr["ID"] == DBNull.Value ? (decimal)0 : (decimal)dr["ID"];
            QS_YG_YONGHUXX.S_XINGZHENGQBH = dr["S_XINGZHENGQBH"] == DBNull.Value ? null : (string)dr["S_XINGZHENGQBH"];
            QS_YG_YONGHUXX.S_BUMENBH = dr["S_BUMENBH"] == DBNull.Value ? null : (string)dr["S_BUMENBH"];
            QS_YG_YONGHUXX.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string)dr["S_YONGHUH"];
            QS_YG_YONGHUXX.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string)dr["S_YONGHUM"];
            QS_YG_YONGHUXX.S_YOUBIAN = dr["S_YOUBIAN"] == DBNull.Value ? null : (string)dr["S_YOUBIAN"];
            QS_YG_YONGHUXX.S_DIZHI = dr["S_DIZHI"] == DBNull.Value ? null : (string)dr["S_DIZHI"];
            QS_YG_YONGHUXX.S_DIANHUA = dr["S_DIANHUA"] == DBNull.Value ? null : (string)dr["S_DIANHUA"];
            QS_YG_YONGHUXX.S_LIANXIBM = dr["S_LIANXIBM"] == DBNull.Value ? null : (string)dr["S_LIANXIBM"];
            QS_YG_YONGHUXX.S_LIANXIR = dr["S_LIANXIR"] == DBNull.Value ? null : (string)dr["S_LIANXIR"];
            QS_YG_YONGHUXX.S_LIUYUBH = dr["S_LIUYUBH"] == DBNull.Value ? null : (string)dr["S_LIUYUBH"];
            QS_YG_YONGHUXX.S_SHUIZIYBH = dr["S_SHUIZIYBH"] == DBNull.Value ? null : (string)dr["S_SHUIZIYBH"];
            QS_YG_YONGHUXX.S_FENPIANBH = dr["S_FENPIANBH"] == DBNull.Value ? null : (string)dr["S_FENPIANBH"];
            QS_YG_YONGHUXX.S_HUANXIANBJ = dr["S_HUANXIANBJ"] == DBNull.Value ? null : (string)dr["S_HUANXIANBJ"];
            QS_YG_YONGHUXX.S_QUSHUIYTBH = dr["S_QUSHUIYTBH"] == DBNull.Value ? null : (string)dr["S_QUSHUIYTBH"];
            QS_YG_YONGHUXX.S_HANGYEBH = dr["S_HANGYEBH"] == DBNull.Value ? null : (string)dr["S_HANGYEBH"];
            QS_YG_YONGHUXX.N_SHUIJIA = dr["N_SHUIJIA"] == DBNull.Value ? null : (decimal?)dr["N_SHUIJIA"];
            QS_YG_YONGHUXX.I_BIAOSHI = dr["I_BIAOSHI"] == DBNull.Value ? null : (decimal?)dr["I_BIAOSHI"];
            QS_YG_YONGHUXX.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string)dr["S_KAIHUHM"];
            QS_YG_YONGHUXX.S_KAIHUH = dr["S_KAIHUH"] == DBNull.Value ? null : (string)dr["S_KAIHUH"];
            QS_YG_YONGHUXX.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string)dr["S_KAIHUYH"];
            QS_YG_YONGHUXX.S_YEWUY = dr["S_YEWUY"] == DBNull.Value ? null : (string)dr["S_YEWUY"];
            QS_YG_YONGHUXX.S_ZHUSHI = dr["S_ZHUSHI"] == DBNull.Value ? null : (string)dr["S_ZHUSHI"];
            QS_YG_YONGHUXX.I_WTYPE = dr["I_WTYPE"] == DBNull.Value ? null : (decimal?)dr["I_WTYPE"];
            QS_YG_YONGHUXX.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?)dr["I_JLZT"];
            QS_YG_YONGHUXX.S_TIANJIAR = dr["S_TIANJIAR"] == DBNull.Value ? null : (string)dr["S_TIANJIAR"];
            QS_YG_YONGHUXX.D_TIANJIARQ = dr["D_TIANJIARQ"] == DBNull.Value ? null : (DateTime?)dr["D_TIANJIARQ"];
            QS_YG_YONGHUXX.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string)dr["S_CAOZUOR"];
            QS_YG_YONGHUXX.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?)dr["D_CAOZUORQ"];
            QS_YG_YONGHUXX.S_YUANYONGHUH = dr["S_YUANYONGHUH"] == DBNull.Value ? null : (string)dr["S_YUANYONGHUH"];
            QS_YG_YONGHUXX.S_DESTUSER = dr["S_DESTUSER"] == DBNull.Value ? null : (string)dr["S_DESTUSER"];
            QS_YG_YONGHUXX.S_KAISHINY = dr["S_KAISHINY"] == DBNull.Value ? null : (string)dr["S_KAISHINY"];
            QS_YG_YONGHUXX.S_JIESHUNY = dr["S_JIESHUNY"] == DBNull.Value ? null : (string)dr["S_JIESHUNY"];
            QS_YG_YONGHUXX.S_CAIWUYB = dr["S_CAIWUYB"] == DBNull.Value ? null : (string)dr["S_CAIWUYB"];
            QS_YG_YONGHUXX.S_CAIWUDZ = dr["S_CAIWUDZ"] == DBNull.Value ? null : (string)dr["S_CAIWUDZ"];
            QS_YG_YONGHUXX.S_HETONGH = dr["S_HETONGH"] == DBNull.Value ? null : (string)dr["S_HETONGH"];
            QS_YG_YONGHUXX.S_YINHANG = dr["S_YINHANG"] == DBNull.Value ? null : (string)dr["S_YINHANG"];
            QS_YG_YONGHUXX.S_CAIWUHM = dr["S_CAIWUHM"] == DBNull.Value ? null : (string)dr["S_CAIWUHM"];
            QS_YG_YONGHUXX.S_ZHUANGBIAOJL = dr["S_ZHUANGBIAOJL"] == DBNull.Value ? null : (string)dr["S_ZHUANGBIAOJL"];
            QS_YG_YONGHUXX.S_FEETYPE = dr["S_FEETYPE"] == DBNull.Value ? null : (string)dr["S_FEETYPE"];
            QS_YG_YONGHUXX.I_YONGHUZT = dr["I_YONGHUZT"] == DBNull.Value ? null : (decimal?)dr["I_YONGHUZT"];
            QS_YG_YONGHUXX.S_CAIWUBM = dr["S_CAIWUBM"] == DBNull.Value ? null : (string)dr["S_CAIWUBM"];
            QS_YG_YONGHUXX.S_BY1 = dr["S_BY1"] == DBNull.Value ? null : (string)dr["S_BY1"];
            QS_YG_YONGHUXX.S_BY2 = dr["S_BY2"] == DBNull.Value ? null : (string)dr["S_BY2"];
            QS_YG_YONGHUXX.S_BY3 = dr["S_BY3"] == DBNull.Value ? null : (string)dr["S_BY3"];
            QS_YG_YONGHUXX.I_BY1 = dr["I_BY1"] == DBNull.Value ? null : (decimal?)dr["I_BY1"];
            QS_YG_YONGHUXX.I_BY2 = dr["I_BY2"] == DBNull.Value ? null : (decimal?)dr["I_BY2"];
            QS_YG_YONGHUXX.I_BY3 = dr["I_BY3"] == DBNull.Value ? null : (decimal?)dr["I_BY3"];
            return QS_YG_YONGHUXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion